package net.xiaoyu233.mitemod.miteite.item;

import net.minecraft.*;
import net.xiaoyu233.mitemod.miteite.inventory.container.MinePocketInventory;

public class ItemMinePocket extends Item {
    public ItemMinePocket(int id, Material material) {
        super(id, material, null);
        this.setMaxStackSize(1);
        this.setCreativeTab(CreativeModeTab.tabTools);
    }

    @Override
    public boolean onItemRightClick(EntityPlayer player, float partial_tick, boolean ctrl_is_down) {
        ItemStack heldItemStack = player.getHeldItemStack();
        if (heldItemStack.getItem() instanceof ItemMinePocket) {
            if (player.onServer()) {
                player.displayGUIMinePocketInventory(new MinePocketInventory(heldItemStack.getDisplayName(), false, heldItemStack));
            }
            return true;
        }
        return false;
    }
}
